package com.cqw.order.handlers;

import com.cqw.handers.BaseEnumHandler;
import com.cqw.order.enums.SpuStateEnum;

/**
 * @Author: caoqingwen
 * @CreateTime: 2021-07-12 23:03
 * @Description:
 */
public class SpuStateEnumHandler extends BaseEnumHandler<SpuStateEnum> {


    /**
     * 通过枚举对象得到数字
     *
     * @param enumEntity
     * @return
     */
    @Override
    public Integer getCode(SpuStateEnum enumEntity) {
        return enumEntity.code();
    }

    /**
     * 通过数字得到枚举对象
     *
     * @param code
     * @return
     */
    @Override
    public SpuStateEnum getEnumEntity(int code) {
        return SpuStateEnum.parse(code);
    }
}
